<%@ page pageEncoding="utf-8"%>
<%@page import="edu.pet.entity.Pet" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
  <head>
    <link rel="stylesheet" type="text/css" href="allpage.css" >
    <title>宠物诊所</title>
  </head>
  <script type="text/javascript" src="../user/table_style.js"></script>
  <script language="javascript" type="text/javascript" src="../user/DatePicker/WdatePicker.js"></script>
  <%
  	Pet pet = new Pet();
  	pet = (Pet)session.getAttribute("pet");
  %>
  <body>
  <div class="background">
  <jsp:include page="suc.jsp"></jsp:include>
	  	<form action="../servlet/PetUpdateServlet" method="post">
	  		<input type="hidden" value="<%=pet.getPet_id() %>" name="pet_id" />
		  	<input type="hidden" name="handle" value="update" />
		  	<table align="center">
		  		<tr>
		  			<td>宠物名称</td>
		  			<td><input type="text" name="pet_name" value="<%=pet.getName() %>"/></td>
		  		</tr>
		  		<tr>
		  			<td>类型</td>
		  			<td>
						<select name="type_id">
		  					<c:forEach items="${types}" var="oneType">
		  						<option value="${oneType.type_id }">${oneType.type}</option>
		  					</c:forEach>
		  				</select>
					</td>
		  		</tr>
		  		<tr>
		  			<td>出生日期</td>
		  			<td><input type="text" name="birthday" value="<%=pet.getBirthday() %>" onClick="WdatePicker()"/></td>
		  		</tr>
		  		<tr>
		  			<td>所有人名称</td>
		  			<td>
						<select name="owner_id">
		  					<c:forEach items="${owners}" var="oneOwner">
		  						<option value="${oneOwner.owner_id }">${oneOwner.name}</option>
		  					</c:forEach>
		  				</select>
					</td>
		  		</tr>
		  		<tr>
		  			<td>
				  		<input type="submit" value="修改"  />
		  			</td>
		  			<td>
				  		<input type="button" value="放弃" onclick="javascript:window.location='petownerinfo.jsp'"/>
		  			</td>
		  		</tr>
		  		
		  	</table>
	  	</form>
  	</div>
   </body>
</html>
